import { marker } from '@/db';
import type {
  IApiAddMarkerParams,
  IApiEditMarkerParams,
  IApiFindAllMarkerResult,
  IApiFindMarkerParams,
  IApiFindMarkerResult,
  IApiRes,
} from './types';

export const addMarker = (data: IApiAddMarkerParams) => marker.add(data) as Promise<IApiRes>;

export const deleteMarker = (data: string) => marker.delete(data) as Promise<IApiRes>;

export const editMarker = (data: IApiEditMarkerParams) => marker.edit(data) as Promise<IApiRes>;

export const findMarker = (data: IApiFindMarkerParams) => marker.find(data) as Promise<IApiFindMarkerResult>;

export const findAllMarker = () => marker.findAll() as Promise<IApiFindAllMarkerResult>;
